<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Internal.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Aga.Psad.Mvc.Models.Despachos.DespachoViewModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Despachos
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Listado de Desspachos</h2>

    <table>
        <tr>
            <th>
                Creado
            </th>
            <th>
                Legajo
            </th>
            <th>
                Declarante
            </th>
            <th>
                Importador / Exportador
            </th>
            <th>
                Caja
            </th>
            <th></th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.Creado)) %>
            </td>
            <td>
                <%= Html.Encode(item.Legajo) %>
            </td>
            <td>
                <%= Html.Encode(item.Declarante.RazonSocial) %>
            </td>
            <td>
                <%= Html.Encode(item.ImportadorExportador.RazonSocial) %>
            </td>
            <td>
                <%= Html.Encode(item.Caja) %>
            </td>
            <td>
                <%= Html.ActionLink("Editar", "Edit", new { id = item.Id })%> |
                <%= Html.ActionLink("Ver Detalle", "Details", new { id = item.Id })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Nuevo Despacho", "Create")%>
    </p>

</asp:Content>

